package com.njbdqn.air.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.njbdqn.air.dao.AirDAO;
import com.njbdqn.air.domain.Air;
import com.njbdqn.componses.bean.PageBean;
import com.njbdqn.componses.bean.PageParam;

@Service
@Transactional
public class AirService {
	@Autowired
	private AirDAO adao;
	@Autowired
	private PageBean<Air> pb;
	
	public void saveAir(Air air){
		adao.save(air);
	}
	
	public void deleteAir(int airid){
		adao.delete(airid);
	}
	
	public void updateAirInfo(Air air){
		adao.update(air);
	}
	
	public List<Air> findAllArea(){
		return adao.findAllArea();
	}
	
	public Air findById(int airid){
		return adao.findByAirId(airid);
	}
	
	public PageBean<Air> findBean(PageParam pip){
		pb.setPip(pip);
		return pb.openBean();
	}
	
}
